<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <script type="text/javascript" >
		$(document).ready(function(){
			 $("#link").blur(function(){
				 if($("#link").val().length<=0){
					 showMessage("span#linkMessage","red",'请输入用户名！');
					 return false;
				 }
				$.ajax({
					    url:'/checkLink'?random="+Math.random()',     
					    type:'post',     
					    data:'link='+$('#link').val(),     
					    success:function(data){     
					       if(data == false){
					    	   showMessage("span#linkMessage","green",'该名称可以使用！');
					       }else{
					    	   showMessage("span#linkMessage","red",'该名称已被使用！');
					       }
					    },
					    error:function (XMLHttpRequest, textStatus, errorThrown) {
							/* alert(XMLHttpRequest.status);
							alert(textStatus);
							alert(errorThrown);
					         // 通常情况下textStatus和errorThown只有其中一个有值 
					         this; // the options for this ajax request */
					     }
					});
			    return false;
			  });
		});
		
		function showMessage(selector,color,message){
			$(selector).css("color",color);
		    $(selector).html(message);
		}
	</script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>添加</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>

<body>
<form id="form1" name="form1" method="post" action="<s:url value='/a/addMain'/>">
<table width="445" border="1">
  <tr>
    <td width="97">链接</td>
    <td width="332">
      <label for="link"></label>
      <input type="text" name="link" id="link" />
      <span id="linkMessage"></span>
   </td>
  </tr>
  <tr>
    <td>标题</td>
    <td><input type="text" name="title" id="title" /></td>
  </tr>
  <tr>
    <td>摘要</td>
    <td><label for="abstracts"></label>
      <textarea name="abstracts" id="abstracts" cols="45" rows="5"></textarea></td>
  </tr>
  <tr>
    <td>标签</td>
    <td><input type="text" name="name" id="name" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="button" id="button" value="提交" /></td>
  </tr>
</table>
 </form>
 <br>
 </p>
 <table width="449" height="166" border="1">
   <tr>
     <td width="205"><div class="aa" id="aaa">logl 标题，url</div></td>
     <td width="67">&nbsp;</td>
     <td width="155"><div class="aa" id="aaa">不喜欢,举报</div></td>
   </tr>
   <tr>
     <td><div class="aa" id="aaa">时间，标签</div></td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
   </tr>
   <tr>
     <td><div class="aa" id="aaa">
       <p>摘要正文</p>
       <p>&nbsp;</p>
       <p>&nbsp;</p>
       <p>&nbsp;</p>
       <p>&nbsp;</p>
       <p>&nbsp;</p>
     </div>
     
   </td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
   </tr>
   <tr>
     <td><div class="aa" id="aaa">+1</div>&nbsp;</td>
     <td><div class="aa" id="aaa">收藏</div></td>
     <td><div class="aa" id="aaa">评论</div></td>
   </tr>
   <tr>
     <td>评论内容</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
   </tr>
   <tr>
     <td><div class="aa" id="aaa">评论内容 +1</div></td>
     <td><div class="aa" id="aaa"></div></td>
     <td><div class="aa" id="aaa">举报</div></td>
   </tr>
 </table>
 <p>&nbsp; </p>
</body>
</html>
